package game;

import utils.ResourceManager;

import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.StateBasedGame;

import states.BattleState;
import states.InGameState;
import states.IntroState;
import states.MainMenuState;

public class PokemonGame extends StateBasedGame {

	public PokemonGame(String name) {
		super(name);
	}

	@Override
	public void initStatesList(GameContainer container) throws SlickException {
		// hide mouse
		ResourceManager.init();
//		container.setMouseGrabbed(true);
		// deferred loading = true
//		LoadingList.setDeferredLoading(true);
		// init resources
//		ResourceManager.init();
		// init MusicPlayer
//		MusicPlayer.init();
		// add states
		addState(new MainMenuState());
		addState(new IntroState());
		addState(new InGameState());
		addState(new BattleState());
		
	}

	public static void loadOptions(AppGameContainer game) throws SlickException {
		// load options
//		PropertiesFile opt = Config.getOption();
//		boolean fullscreen = opt.getBoolean("fullscreen");
//		boolean vSync = opt.getBoolean("vSync");
//		boolean showFPS = opt.getBoolean("showFPS");
//		boolean shuffle = opt.getBoolean("shuffle");
//		float sound = opt.getFloat("soundVolume");
//		float music = opt.getFloat("musicVolume");
//		if (shuffle) {
//			MusicPlayer.toggleShuffle();
//		} else {
//			MusicPlayer.toggleRepeatAll();
//		}
		// set icon
		// game.setIcon("data/image/ui/icon.png");
//		game.setUpdateOnlyWhenVisible(false);
//		game.setMusicVolume(music);
//		game.setSoundVolume(sound);
//		game.setDisplayMode(800, 600, false);
		game.setDisplayMode(640, 640, false);
		game.setShowFPS(false);
//		game.setVSync(vSync);
//		game.setVerbose(false);
//		game.setMaximumLogicUpdateInterval(20);
//		game.setMinimumLogicUpdateInterval(20);
		// game.setTargetFrameRate(100);
	}

	@Override
	public boolean closeRequested() {
		return false;
	}

}
